package com.zhima.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhima.dto.FeignDownloadResultDTO;
import com.zhima.dto.FeignUploadResultDTO;
import com.zhima.entity.OjFile;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhima
 * @since 2023-08-25
 */
public interface OjFileService extends IService<OjFile> {
    FeignUploadResultDTO uploadFile(Long uploaderId, String bucket, String fileName, byte[] bytes);

    FeignUploadResultDTO uploadFile(String bucket, String fileAbsolutePath);

    FeignUploadResultDTO mergeChunk(String bucket, String fileMd5, String chunkFileName, Integer chunkSize);

    boolean checkChunk(String bucket, String fileMd5, Integer chunkIndex);

    boolean existsFile(String bucket, String objectName);

    byte[] download(String bucket, String objectName);

    FeignDownloadResultDTO downloadByFileId(Long fileId);

    FeignDownloadResultDTO downloadByObjectId(String objectId);

    void deleteFileByFileId(Long fileId);
}
